package com.itheima.controller;

import com.itheima.domain.OmsOrderSetting;
import com.itheima.manager.OmsOrderSettingManager;
import com.itheima.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
public class OmsOrderSettingController {

    @Autowired
    OmsOrderSettingManager omsOrderSettingManager;

    @PostMapping("/orderSetting/update/{id}")
    public R update(@PathVariable long id, @RequestBody OmsOrderSetting orderSetting){
        omsOrderSettingManager.updateSetting(id,orderSetting);
        return R.success("");
    }

    @GetMapping("/orderSetting/{id}")
    public R getSetting(@PathVariable long id){
        OmsOrderSetting orderSetting = omsOrderSettingManager.getSetting(id);
        return R.success(orderSetting);
    }
}
